package lbframework.bean.table;

import java.beans.*;

public class LBTableBeanInfo extends SimpleBeanInfo {    
    private final static Class beanClass = LBTable.class;
    private static BeanDescriptor beanDescriptor = null;
    private static java.awt.Image icon = null;
    
    @Override
    public BeanDescriptor getBeanDescriptor() {
        beanDescriptor = new BeanDescriptor(beanClass);
        beanDescriptor.setDisplayName("LB Table");
        
        return beanDescriptor;
    }

    @Override
    public PropertyDescriptor[] getPropertyDescriptors() {
        try {
            PropertyDescriptor habilitaOrdenacaoPD = new PropertyDescriptor("habilitaOrdenacao", beanClass);
            
            PropertyDescriptor oProperty[] = new PropertyDescriptor[] {
                habilitaOrdenacaoPD
            };

            return oProperty;
            
        } catch (Exception ex) {
            throw new Error(ex.toString());
        }
    }
    
    @Override
    public BeanInfo[] getAdditionalBeanInfo() {
        Class superclass = LBTable.class.getSuperclass();
        
        try {
            BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
            
            return new BeanInfo[] {
                superBeanInfo
            };
            
        } catch (IntrospectionException ex) {
            ex.printStackTrace();
            return null;
        } 
    }
    
    @Override
    public java.awt.Image getIcon(int iconKind) {
        if (iconKind == ICON_COLOR_16x16 || iconKind == ICON_MONO_16x16) {
            icon = loadImage("table16.png");
        } else if (iconKind == ICON_COLOR_32x32 || iconKind == ICON_MONO_32x32) {
            icon = loadImage("table32.png");
        } else {
            icon = null;
        }
        
        return icon;
    }
}